package com.ostrich.note.ui.settings.repository;


import com.ostrich.note.entity.BaseResponseEntity;
import com.ostrich.note.net.RetrofitManager;
import com.ostrich.note.ui.note.NoteApi;
import com.ostrich.note.ui.note.entity.NoteEntity;
import com.ostrich.note.ui.note.entity.TypeEntity;
import com.ostrich.note.ui.settings.SettingsApi;
import com.ostrich.note.ui.settings.entity.OptionEntity;
import com.ostrich.note.ui.settings.entity.UserEntity;

import java.util.List;

import androidx.lifecycle.LiveData;
import retrofit2.http.Query;

public class SettingsRepository {
    private SettingsApi mSettingsApi;
    public SettingsRepository() {
        mSettingsApi = RetrofitManager.getInstance().getRetrofit().create(SettingsApi.class);
    }

    //分类列表
    public LiveData<BaseResponseEntity<TypeEntity>> notepadClassifiedData(){
        return mSettingsApi.notepadClassifiedData();
    }
    //收藏列表
    public LiveData<BaseResponseEntity<List<NoteEntity>>> notepadCollectList(){
        return mSettingsApi.notepadCollectList();
    }
    //用户查询
    public LiveData<BaseResponseEntity<UserEntity>> noteUserQueue(){
        return mSettingsApi.noteUserQueue();
    }

    //用户修改
    public LiveData<BaseResponseEntity> noteUserEdit(String name,String avatar,String signature){
        return mSettingsApi.noteUserEdit(name,avatar,signature);
    }

    public LiveData<BaseResponseEntity> notepadClassDel(int type_id){
        return mSettingsApi.notepadClassDel(type_id);
    }

    public LiveData<BaseResponseEntity> insertNotepadType(String title,int color){
        return mSettingsApi.insertNotepadType(title,color);
    }




    public LiveData<BaseResponseEntity> notepadTitleEdit(String title,int color, int type_id){
        return mSettingsApi.notepadTitleEdit(title,color,type_id);
    }

    public  LiveData<BaseResponseEntity<OptionEntity>> appConfigGetOne(){
        return mSettingsApi.appConfigGetOne();
    }


}
